// function CustomToString(target: Function) {
//   target.prototype.toString = function () {
//     return JSON.stringify(this);
//   };
// }

// @CustomToString
// class Person {
//   constructor(
//     public name: string,
//     public age: number
//   ) {}
// }

// const p1 = new Person('张三', 18);
// console.log(p1.toString());

function Demo(target:Function) {
  return class {
    constructor(
      public name: string,
      public age: number
    ) {}
    test() {
      console.log('1');
    }
  }
}

@Demo
class Person {
  constructor(
    public name: string,
    public age: number
  ) {}

}
export {}